package business

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type OptionRouter struct {
}

// InitOptionRouter 初始化 选项内容 路由信息
func (s *OptionRouter) InitOptionRouter(Router *gin.RouterGroup) {
	optionRouter := Router.Group("option").Use(middleware.OperationRecord())
	optionRouterWithoutRecord := Router.Group("option")
	var optionApi = v1.ApiGroupApp.BusinessApiGroup.OptionApi
	{
		optionRouter.POST("createOption", optionApi.CreateOption)             // 新建选项内容
		optionRouter.DELETE("deleteOption", optionApi.DeleteOption)           // 删除选项内容
		optionRouter.DELETE("deleteOptionByIds", optionApi.DeleteOptionByIds) // 批量删除选项内容
		optionRouter.PUT("updateOption", optionApi.UpdateOption)              // 更新选项内容
	}
	{
		optionRouterWithoutRecord.GET("findOption", optionApi.FindOption)       // 根据ID获取选项内容
		optionRouterWithoutRecord.GET("getOptionList", optionApi.GetOptionList) // 获取选项内容列表
	}
}
